<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>12345</title>
</head>

<body>
<script type="text/javascript">
    window.onload=function(){
        Foo.getName();//2
        getName();//4
        Foo().getName();//1 此处实际上将外层作用域内的getName函数修改了 Window.getName();
        getName();//1
        new Foo.getName();//2
        new Foo().getName();//3
        new new Foo().getName();//3


    }
    function Foo(){
        getName=function (){alert(1);};
        return  this;
    }
    Foo.getName=function (){alert(2);};
    Foo.prototype.getName=function (){alert(3);};
    var getName=function(){alert(4);};
    function getName(){ alert(5);};
</script>
</body>
</html>